package com.alienlab.finder.service;

import com.alienlab.finder.domain.CheckTask;

import com.alienlab.finder.service.dto.CheckTaskDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Optional;

/**
 * Service Interface for managing CheckTask.
 */
public interface CheckTaskService {

    /**
     * Save a checkTask.
     *
     * @param checkTask the entity to save
     * @return the persisted entity
     */
    CheckTask save(CheckTask checkTask);

    /**
     * Get all the checkTasks.
     *
     * @param pageable the pagination information
     * @return the list of entities
     */
    Page<CheckTask> findAll(Pageable pageable);


    /**
     * Get the "id" checkTask.
     *
     * @param id the id of the entity
     * @return the entity
     */
    Optional<CheckTask> findOne(Long id);

    /**
     * Delete the "id" checkTask.
     *
     * @param id the id of the entity
     */
    void delete(Long id);

    //创建一个监控任务
    CheckTask creatTask(String admin_open_id,String guest_open_id,String origin_x,String origin_y) throws Exception;

    //停止一条监控任务
    CheckTask stopTask(Long task_id) throws Exception;

    //更新一项监控任务的预警
    CheckTask addTaskWarning(Long task_id,Long warning_id) throws Exception;

    //被监控人查看监控记录
    List<CheckTaskDTO> guestChecktaskList(String guest_open_id) throws Exception;

    //监控人查看监控记录
    List<CheckTaskDTO> adminChecktaskList(String admin_open_id) throws Exception;

    //监控人查看正在被监控的监控人列表信息
    List<String> getMonitoredList(String admin_open_id) throws Exception;

    String taskIsDoing(String admin_open_id,String guest_open_id);

    //被监控人查看是否有监控任务正在进行
    String getDoingtask(String guest_open_id);

}
